package 天梯赛.A;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int x=sc.nextInt();  // 关总的
        int y=sc.nextInt();
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=sc.nextInt();
        int m=0;
        int n=0;

        if (a==0){
            m++;
        }else{
            n++;
        }
        if (b==0){
            m++;
        }else{
            n++;
        }
        if (c==0){
            m++;
        }else{
            n++;
        }
//        System.out.println(x);
//        System.out.println(y);

        //327  129
        //全票
        if (x<y&&m==3){
            System.out.println("The winner is a: "+x+" + "+m);
            System.exit(0);
        }

        if (y<x&&n==3){
            System.out.println("The winner is b: "+y+" + "+n);
            System.exit(0);
        }
        // A全票呢
        if(x>y&&m!=0){
            System.out.println("The winner is a: "+x+" + "+m);
            System.exit(0);
        }

        if (y>x&&n!=0){
            System.out.println("The winner is b: "+y+" + "+n);
            System.exit(0);
        }

    }
}
